package fr.micouz.gwt.dispatch.server;

import net.customware.gwt.dispatch.server.ActionHandler;
import net.customware.gwt.dispatch.server.ExecutionContext;
import net.customware.gwt.dispatch.shared.ActionException;

import fr.micouz.gwt.dispatch.shared.MyAction;
import fr.micouz.gwt.dispatch.shared.MyResult;

public class MyActionHandler implements ActionHandler<MyAction, MyResult> {

	public MyResult execute(MyAction action, ExecutionContext context) throws ActionException {
		return new MyResult("Got message: " + action.getMessage());
	}

	public Class<MyAction> getActionType() {
		return MyAction.class;
	}

	public void rollback(MyAction action, MyResult result, ExecutionContext context) throws ActionException {
		// implement this if you want to use this action in compound actions
	}

}
